home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Union of Adjacent ODShapes < prev    next >
Encoding:
Internet Message Format  |  1996-08-01  |  1.7 KB  |  [TEXT/ttxt]

  1. Subject:     Union of Adjacent ODShapes
  2. Sent:        6/25/96 8:04 PM
  3. Received:    7/1/96 8:35 AM
  4. From:        Serge Froment, sfroment@odyssee.net
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Dear ODF and OpenDoc Teams:
  9.  
  10. I create an ODShape, set it as a rect and Union three adjacent rect to it,
  11. and return it as the result of CMySelection::CreateSelectionShape. The
  12. resulting drag outline, instead of one large rectangle, is made of four
  13. small adjacent outlines.
  14.  
  15. Here is my code:
  16.  
  17. ODShape* CCalendarShape::CreateSelectionShape(Environment* ev,
  18. FW_CGraphicContext& gc, const CDateCollection& selection) const
  19. {
  20.         FW_CAcquiredODShape aqSelectionShape = ::FW_NewODShape(ev);
  21.         FW_CAcquiredODShape aqTempShape = ::FW_NewODShape(ev);
  22.         FW_Boolean first = true;
  23.  
  24.         CDateCollectionIterator iter(selection, fMonth);
  25.         for (CDate date = iter.First(); iter.IsNotComplete(); date =
  26. iter.Next())
  27.         {
  28.                 FW_CRect dayCell = this->GetDateRect(gc, date);
  29.                 if (first)
  30.                 {
  31.                         aqSelectionShape->SetRectangle(ev, (ODRect*) &dayCell);
  32.                         first = false;
  33.                 }
  34.                 else
  35.                 {
  36.                         aqTempShape->SetRectangle(ev, (ODRect*) &dayCell);
  37.                         aqSelectionShape->Union(ev, aqTempShape);
  38.                 }
  39.         }
  40.  
  41.         aqSelectionShape->Acquire(ev);
  42.         return aqSelectionShape;
  43. }
  44.  
  45. The successive values of dayCell (left, top, right, bottom) are:
  46.  
  47. 18, 69, 31, 80
  48. 31, 69, 44, 80
  49. 44, 69, 57, 80
  50. 57, 69, 70, 80
  51.  
  52. Is this a bug?
  53.  
  54. Serge
  55.  
  56.